package com.tfj.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.hyphenate.tfj.R;

public class TrangleBubble extends RelativeLayout {
    private Context context;
    private TextView tv_content;
    private ImageView iv_triangle;
    private RelativeLayout rl_out;

    public TrangleBubble(Context context) {
        super(context);
        this.context = context;
        initView(context);
    }

    public TrangleBubble(Context context, AttributeSet attrs) {
        super(context, attrs);
        initView(context);
        initAttrs(context, attrs);
    }


    public TrangleBubble(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initView(context);
        initAttrs(context, attrs);
    }

    public void initView(final Context context) {
        LayoutInflater.from(context).inflate(R.layout.layout_bubble, this, true);
        tv_content = findViewById(R.id.tv_content);
        iv_triangle = findViewById(R.id.iv_triangle);
        rl_out = findViewById(R.id.rl_out);

    }
    public  void setText(String text){
        tv_content.setText(text);
    }

    private void initAttrs(Context context, AttributeSet attrs) {

    }
    public void setClick(OnClickListener onClickListener) {
        rl_out.setOnClickListener(onClickListener);
    }
}
